package priv.yiyuan.example.design.visitor.decorator;

import priv.yiyuan.example.design.visitor.ConfigurationVisitor;
import priv.yiyuan.example.design.visitor.DatabaseConfig;
import priv.yiyuan.example.design.visitor.NetworkConfig;

/**
 * 装饰者抽象类 配置访问者装饰器
 *
 * @author YiYuan
 * @data 2025/8/4
 * @apoNote
 */
public abstract class ConfigurationVisitorDecorator implements ConfigurationVisitor {

    protected ConfigurationVisitor decoratedVisitor;

    public ConfigurationVisitorDecorator(ConfigurationVisitor decoratedVisitor) {
        this.decoratedVisitor = decoratedVisitor;
    }

    @Override
    public void visit(DatabaseConfig element) {
        decoratedVisitor.visit(element);
    }

    @Override
    public void visit(NetworkConfig element) {
        decoratedVisitor.visit(element);
    }

}
